import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:material_collection_app/utils/utils.dart';

class RoundCheckBox extends StatefulWidget {
  bool select; 
  RoundCheckBox({
    Key key, 
    @required this.select, 
    this.onChanged
  }) : super(key: key);

  Function() onChanged;

  @override
  _RoundCheckBoxState createState() => _RoundCheckBoxState();
}

class _RoundCheckBoxState extends State<RoundCheckBox> {
  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context, width: 750, height: 1334, allowFontScaling: false);

    return Center(
      child: GestureDetector(
        onTap: () {
          widget.select = !widget.select;
          widget.onChanged();
        },
        child: Container(
          child: widget.select ? 
          Icon(Icons.check_circle,size: 22,color: Utils.hexToColor('#297CFF')) : 
          Icon(Icons.panorama_fish_eye, size: 22,color: Utils.hexToColor('#D4D4D4'))
        )
      )
    );
  }
}
